
import { _decorator, Component, Node ,Label} from 'cc';
const { ccclass, property } = _decorator;

/**
 * Predefined variables
 * Name = gameclick
 * DateTime = Wed Apr 13 2022 12:47:48 GMT+0800 (中国标准时间)
 * Author = xiaopang125
 * FileBasename = gameclick.ts
 * FileBasenameNoExtension = gameclick
 * URL = db://assets/gameclick.ts
 * ManualUrl = https://docs.cocos.com/creator/3.4/manual/zh/
 *
 */
 
@ccclass('gameclick')
export class gameclick extends Component {
    public count = 0;
    // [1]
    // dummy = '';
    // [2]
    // @property
    // serializableDummy = 0;

    @property({type:Label})
    Score=null;

    start () {
        var _this=this;
        console.log("gameclickstart");
        
        // [3]
        this.node.on(Node.EventType.TOUCH_END,this.stageclick,this)
    }

    private stageclick(event){
        this.count++;
        console.log(this.Score);         
        this.Score.string=this.count+'';
    }
    // public clickRemove(moveIndex: number) {
    //     this.node.on(Node.EventType.MOUSE_DOWN,this.stageclick,this)
    // }

    // update (deltaTime: number) {
    //     // [4]
    // }
}

/**
 * [1] Class member could be defined like this.
 * [2] Use `property` decorator if your want the member to be serializable.
 * [3] Your initialization goes here.
 * [4] Your update function goes here.
 *
 * Learn more about scripting: https://docs.cocos.com/creator/3.4/manual/zh/scripting/
 * Learn more about CCClass: https://docs.cocos.com/creator/3.4/manual/zh/scripting/decorator.html
 * Learn more about life-cycle callbacks: https://docs.cocos.com/creator/3.4/manual/zh/scripting/life-cycle-callbacks.html
 */
